import Vue from 'vue';

Vue.filter("formatNum",function(value,num=2){
    if(value>10000){
return Number(value/10000).toFixed(num)+"万";
    }else{
        return Number(value).toFixed(num)
    }
    
})
 


Vue.filter("high",function(val,value){
    let reg = new RegExp(`${value}`, "g");
    if (reg.test(val) && value.length>0) {
        val = val.replace(reg, `<b style="color:#20d59b">${value}</b>`);
      }
      return val;
   

    })

 
      Vue.filter("filterchar",function(val,num){
        return val < num-1  ? "" : "/";
      } )
   
      Vue.filter("formatorder",function(val){
        val++;
            return val < 10 ? "0" + val : val;
      })
      